/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package LogicadeNegocio;


import modelo.beancarrera;
import CapadeDatos.DaoCarrera;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JComboBox;
import javax.swing.JTextField;

/**
 *
 * @author jxtx
 */
public class combocarrera1 {
 JComboBox jcombo;
    ArrayList lista;
    beancarrera[] detalles;
    JTextField textbox;
public combocarrera1(JComboBox combo){
        jcombo = combo;
    }

    public void cargarcarrera() throws Exception{
     // Llamamos al metodo datos modulo que nos devuelve el ArrayList
      lista = (ArrayList) DaoCarrera.listaItem1();
      detalles = new beancarrera[lista.size()];
      Iterator itr = lista.iterator();
      int j=0;
      jcombo.removeAllItems();
      while (itr.hasNext()) {
          detalles[j] =  (beancarrera) itr.next();
          jcombo.addItem(detalles[j].getNombrecarrera());
          j++;
      }

    }
    public  beancarrera[] semestre(){
      return detalles;
    }
}
